package sctu.edu.java.year2016.team05.xionglianjin.day20160526.chapter7_2;

/**
 * Created by lianjin on 2016/5/26
 * 尝试编写一个矩形类，将长与宽作为矩形类的属性，在构造方法中将长、宽初始化，定义一个成员方法求此矩形的面积；.
 */
public class Juxing {
    private double a;
    private double b;
    public Juxing(double a, double b){
        this.a=a;
        this.b=b;
    }
    public double getA(){
        return a;
    }
    public void setA(double a){
        this.a=a;
    }
    public double getB(){
        return b;
    }

    public void setB(double b) {
        this.b = b;
    }
    public double area(){
        return a*b;
    }
    public static void main(String[] args){
        Juxing m=new Juxing(5,6);
        System.out.println(m.area());
    }
}
